import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import {uuid} from "@/utils";
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import VueAxios from 'vue-axios'
Vue.use(VueAxios, axios)
Vue.use(ElementUI);
let uid=uuid(); //获取uuid
if(sessionStorage.getItem('uid')==null){
  sessionStorage.setItem('uid',uid);
}

import uploader from 'vue-simple-uploader'
Vue.use(uploader);

import VueCookies from "vue-cookies";
Vue.use(VueCookies);

// 添加请求拦截器
axios.interceptors.request.use(function (config) {
  config.headers.token=sessionStorage.getItem("token");
  // 在发送请求之前做些什么
  return config;
}, function (error) {
  // 对请求错误做些什么
  return Promise.reject(error);
});




axios.defaults.baseURL='http://127.0.0.1:8100'


Vue.config.productionTip = false
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
